﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NHibernate;
using System.Configuration;
using CodeFirstDomain.Model;

namespace NHibernateSample
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ISession session = NHibernateHelper.GetCurrentSession();

            ITransaction tx = session.BeginTransaction();

            User user = new User();
            user.Name = "Princess";

            session.Save(user);
            tx.Commit();

            NHibernateHelper.CloseSession();
        }
    }
}
